/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Modele;

import Exc.IllegalGamesException;
import java.util.ArrayList;

/**
 *
 * @author Sofiane
 */
public class Loterie {
    private ArrayList<Integer> listeNumero = new ArrayList<Integer>();

    //Le constructeur

    public Loterie(){
		for(int i=0; i < 2; i++){
			int num = (int)(Math.random() * 10);
			while(listeNumero.contains(num)){
				num = (int)(Math.random() * 10);
			}
			listeNumero.add(num);
		}
	}

   
    public boolean match(int val1, int val2)throws IllegalGamesException{

		if(val1 == val2 )throw new IllegalGamesException();
			
		else{
			return 	listeNumero.contains(new Integer(val1)) &&
					listeNumero.contains(new Integer(val2));
		}
	}

    public ArrayList<Integer> getTirage(){
        return this.listeNumero;
    }
      
       
}

